<?php
namespace app\admin\validate;
use think\Validate;

class Advert extends Validate
{
    protected $rule = [
        'title'=>'unique:advert|require|max:25',
        'url'=>'url|unique:advert|require|max:60',
        'desc'=>'require',
    ];

    protected $message  =   [
        'title.require' => '广告标题必须填写',
        'title.max' => '广告标题长度不得大于25位',
        'title.unique'=>'广告标题不得重复！',
        'url.unique'=>'广告地址不得重复！',
        'url.require'=>'广告地址不得为空！',
        'url.url'=>'广告地址格式不正确！',
        'url.max'=>'广告地址不得大于60个字符！',
        'desc.require'=>'广告描述不得为空！',

    ];

    protected $scene = [
        'add'=>['title','url','desc'],
        'edit'  =>  ['title','url'],
    ];




}
